# Contributor: plut0nium <charles(DOT)fourneau(AT)gmail(DOT)com >
#              tzervo <tzervo@gmail.com>
pkgname="owfs"
pkgver=3.1p0
pkgrel=1
pkgdesc="An easy way to use the powerful 1-wire system of Dallas/Maxim."
arch=('any')
url="http://www.owfs.org"
license=('GPL')
groups=()
# Dependencies are not mandatory to build owserver, but:
# - fuse is needed for owfs
# - swig is needed for scripting languages bindings (perl, python...)
depends=('fuse' 'swig' 'python2')
makedepends=()
provides=('owfs')
conflicts=('owfs')
replaces=()
backup=()
options=()
install=
source=("http://downloads.sourceforge.net/sourceforge/owfs/$pkgname-$pkgver.tar.gz" "fix-libusb-includes.patch")
noextract=()
md5sums=('3d8919af078ae8c9171e5713a1789195'
         'f23d0571e00fb869c2e5e0602ed6f628')

prepare() {
	cd "$srcdir/$pkgname-$pkgver"
	patch -p1 -i ../fix-libusb-includes.patch
}

build() {
	cd "$srcdir/$pkgname-$pkgver"

	autoreconf && \
	./configure --disable-swig --disable-owperl --prefix=/usr --with-python="/usr/bin/python2" --with-pythonconfig="/usr/bin/python2-config"
	make
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
	make DESTDIR="$pkgdir" install
}

